package com.zytlifeservice.domain.pay;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * Created by MJS on 2017/5/26.
 */
@MappedSuperclass
public class BaseQmOrder {

    public static final String STATUS_SUCCESS = "success";
    public static final String STATUS_FAIL = "fail";
    public static final String STATUS_WAIT = "wait";
    public static final String STATUS_INIT = "INIT";
    public static final String STATUS_EXCEPTION = "exception";

    public static final int PAY_TYPE_ALIPAY = 0;
    public static final int PAY_TYPE_WXPAY = 1;


    public static final int TYPE_MOBILE_RECHARGE = 0;   //话费
    public static final int TYPE_MOBILE_FLOW = 1;    //流量
    public static final int TYPE_CATV = 2;  //有线电视
    public static final int TYPE_GHKD_RECHARGE = 3;  //宽带固话
    public static final int TYPE_WATER = 4;  //水费
    public static final int TYPE_ELECTRIC = 5;  //电费
    public static final int TYPE_COAL = 6;  //燃气费
    public static final int TYPE_TRAIN=7;//火车票
    public static final int TYPE_AIRPLANE=8;//飞机票


    @Id
    @GeneratedValue
    public Long id;
    //------------------------------------------自定义-------------------------------------------------
    public Long userId;  //用户ID

    public String outTradeNo;  //外部订单号，和支付宝订单统一

    public String payResult;  //订单结果状态  success,fail,exception  异常需人工介入

    public String failReason;  //订单失败原因

    public int payType;  //支付方式类型  0--支付宝 1--微信

    //---------------------------------------千米公共字段--------------------------------------------------

    public String rechargeAccount;  //充值号码  话费，流量--手机  水电煤，有线--缴费账号或户号，卡号

    public String itemId;   //商品编号

    public String saleAmount; //付款金额

    public String orderCost; //实际进价

    public String itemName;  //商品名称

    public String orderTime;  //订单生成时间

    public String billId;//千米内部订单号

    public String supId; //供货商编号

    public String payState;//订单付款状态 0 未付款1 已付款

    public String userCode; //直销商账号

    public int orderType = 0;

    //------------------------------------------------------------------------------------------------------

    public int getOrderType() {
        return orderType;
    }

    public void setOrderType(int orderType) {
        this.orderType = orderType;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getPayResult() {
        return payResult;
    }

    public void setPayResult(String payResult) {
        this.payResult = payResult;
    }

    public String getFailReason() {
        return failReason;
    }

    public void setFailReason(String failReason) {
        this.failReason = failReason;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getSaleAmount() {
        return saleAmount;
    }

    public void setSaleAmount(String saleAmount) {
        this.saleAmount = saleAmount;
    }

    public String getOrderCost() {
        return orderCost;
    }

    public void setOrderCost(String orderCost) {
        this.orderCost = orderCost;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(String orderTime) {
        this.orderTime = orderTime;
    }

    public String getBillId() {
        return billId;
    }

    public void setBillId(String billId) {
        this.billId = billId;
    }

    public String getSupId() {
        return supId;
    }

    public void setSupId(String supId) {
        this.supId = supId;
    }

    public String getPayState() {
        return payState;
    }

    public void setPayState(String payState) {
        this.payState = payState;
    }

    public String getUserCode() {
        return userCode;
    }

    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    public String getRechargeAccount() {
        return rechargeAccount;
    }

    public void setRechargeAccount(String rechargeAccount) {
        this.rechargeAccount = rechargeAccount;
    }


    @Override
    public String toString() {
        return "BaseQmOrder{" +
                "id=" + id +
                ", userId=" + userId +
                ", outTradeNo='" + outTradeNo + '\'' +
                ", payResult='" + payResult + '\'' +
                ", failReason='" + failReason + '\'' +
                ", payType=" + payType +
                ", rechargeAccount='" + rechargeAccount + '\'' +
                ", itemId='" + itemId + '\'' +
                ", saleAmount='" + saleAmount + '\'' +
                ", orderCost='" + orderCost + '\'' +
                ", itemName='" + itemName + '\'' +
                ", orderTime='" + orderTime + '\'' +
                ", billId='" + billId + '\'' +
                ", supId='" + supId + '\'' +
                ", payState='" + payState + '\'' +
                ", userCode='" + userCode + '\'' +
                '}';
    }
}
